****** Table_7_7: Mechanisms: First-order Tests
use data/Demo_book_country_3.dta, clear

*** GDP

*1) benchmark
qui reg Maddison_gdppc_1990_estimate_ln predallports53_100km i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) replace 
qui drop sample

*2) + latitude and regions
qui reg Maddison_gdppc_1990_estimate_ln predallports53_100km lp_lat_abst i.e_regionpol4 i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*3) all geo vars
qui reg Maddison_gdppc_1990_estimate_ln predallports53_100km lp_lat_abst Island landlock_new area_imp_ext_corrected_ln c.prec_gpcc##c.prec_gpcc rivdist_abs_new irri_impact5 tropical avg_temp frstdays soil desert eleva rugged suita suit50_mfish i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** Trade

*4) benchmark
qui reg e_micowimp_ln predallports53_100km i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*5) + latitude and regions
qui reg e_micowimp_ln predallports53_100km lp_lat_abst i.e_regionpol4 i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*6) all geo vars
qui reg e_micowimp_ln predallports53_100km lp_lat_abst Island landlock_new area_imp_ext_corrected_ln c.prec_gpcc##c.prec_gpcc rivdist_abs_new irri_impact5 tropical avg_temp frstdays soil desert eleva rugged suita suit50_mfish i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** Universities

*7) benchmark
qui reg nearest_univ_dist_ln_stock_1 predallports53_100km i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*8) + latitude and regions
qui reg nearest_univ_dist_ln_stock_1 predallports53_100km lp_lat_abst i.e_regionpol4 i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*9) all geo vars
qui reg nearest_univ_dist_ln_stock_1 predallports53_100km lp_lat_abst Island landlock_new area_imp_ext_corrected_ln c.prec_gpcc##c.prec_gpcc rivdist_abs_new irri_impact5 tropical avg_temp frstdays soil desert eleva rugged suita suit50_mfish i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** Naval/land forces

*10) benchmark
qui reg totton_milper predallports53_100km i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*11) + latitude and regions
qui reg totton_milper predallports53_100km lp_lat_abst i.e_regionpol4 i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*12) all geo vars
qui reg totton_milper predallports53_100km lp_lat_abst Island landlock_new area_imp_ext_corrected_ln c.prec_gpcc##c.prec_gpcc rivdist_abs_new irri_impact5 tropical avg_temp frstdays soil desert eleva rugged suita suit50_mfish i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** European ancestry

*13) benchmark
qui reg eur_pct_est_smooth predallports53_100km i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*14) + latitude and regions
qui reg eur_pct_est_smooth predallports53_100km lp_lat_abst i.e_regionpol4 i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*15) all geo vars
qui reg eur_pct_est_smooth predallports53_100km lp_lat_abst Island landlock_new area_imp_ext_corrected_ln c.prec_gpcc##c.prec_gpcc rivdist_abs_new irri_impact5 tropical avg_temp frstdays soil desert eleva rugged suita suit50_mfish i.year, vce(cluster country_id)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_6.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample
